<template>
	<view>
		<u-navbar leftIconColor="#000000" :titleStyle="{ color: '#000000' }" :bgColor="bgColor" title="反馈记录"
			:placeholder="true" :autoBack="true"></u-navbar>
		<view class="note">

		</view>
		<view class="" style="width: 92%;margin: 0 auto;position: relative;z-index: 1;padding-top: 15px;">
			<view @click="det(it)" v-for="(it, i) in arr" class="" style="
			background-color: #fff;
			border-radius: 10px;
			padding: 27px 15px 13px;
			margin-bottom: 15px;
		">
				<view style="width: 100%;
			border-bottom: 1px solid #ececec;padding-bottom: 27px;">
					<view class="tits">
						<view v-html="it.content"></view>
					</view>
					<!-- <view style="font-size: 12px; margin-top: 10px; color: #777979">{{ it.createtime }}</view> -->
				</view>
				<view class="flex" style="padding-top: 13px;justify-content: space-between;">
					<text style="color: #2447FF;">查看详情</text>
					<u-icon name="arrow-right" size="20"></u-icon>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page: 1,
				data: [],
				arr: [],
				status: 'loadmore',
				iconType: 'flower',
				loadText: {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '实在没有了',
				},
				show: false,
				bgColor: 'rgba(255,255,255,0)',
			};
		},
		onPageScroll(e) {
			if (e.scrollTop > 50) {
				this.bgColor = 'rgba(255,255,255,1)'
			} else {
				this.bgColor = 'rgba(255,255,255,0)'
			}
		},
		onLoad() {
			this.feedList();
		},
		onReachBottom() {
			this.show = true;
			if (this.data.length == '') return;
			this.status = 'loading';
			this.page++;
			this.feedList();
			setTimeout(() => {
				if (this.data == '') this.status = 'nomore';
				else this.status = 'loading';
			}, 1000);
		},

		methods: {
			async feedList() {
				let res = await this.$http.car.feedback_list({
					page: this.page,
					pageNum: 10,
				});
				console.log(res);
				if (res.code == 1) {
					this.data = res.data;
					this.arr = [...this.arr, ...this.data];
				}
			},
			det(it) {
				uni.navigateTo({
					url: '/pages/me/ques_detail?id=' + it.id,
				});
			},
		},
	};
</script>

<style scoped lang="scss">
	.tits {
		font-size: 14px;
		font-weight: 400;
		overflow: hidden;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		text-overflow: ellipsis;
		width: 90%;
	}

	.note {
		background-image: url('@/static/font/21.png');
		position: fixed;
		width: 100%;
		height: 100%;
		top: 0;
		background-size: 100% 100%;
	}
</style>
<style>
	page {
		background-color: #f7f9fa;
	}
</style>